package org.example.cake.service.impl;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import org.example.cake.mapper.CategoryMapper;
import org.example.cake.entity.Category;
import org.example.cake.service.CategoryService;

import java.util.List;

@Service
public class CategoryServiceImpl implements CategoryService{

    @Resource
    private CategoryMapper categoryMapper;


    @Override
    public List<Category> selectAllCategory() {
        return categoryMapper.selectAllCategory();
    }

    @Override
    public List<Category> selectCategorysByCategoryName(@Param("categoryname") String categoryname) {
        return categoryMapper.selectCategorysByCategoryName(categoryname);
    }

    @Override
    public List<Category> selectCategorysByCategorydesc(@Param("categorydesc") String categorydesc) {
        return categoryMapper.selectCategorysByCategorydesc(categorydesc);
    }

    @Override
    public int insertCategory(Category category) {
        return categoryMapper.insertCategory(category);
    }

    @Override
    public int updateCategory(Category category) {
        return categoryMapper.updateCategory(category);
    }

    @Override
    public int delCategory(@Param("categoryiud") Integer categoryiud) {
        return categoryMapper.delCategory(categoryiud);
    }


    @Override
    public int deleteByPrimaryKey(Integer categoryid) {
        return categoryMapper.deleteByPrimaryKey(categoryid);
    }

    @Override
    public int insert(Category record) {
        return categoryMapper.insert(record);
    }

    @Override
    public int insertSelective(Category record) {
        return categoryMapper.insertSelective(record);
    }

    @Override
    public Category selectByPrimaryKey(Integer categoryid) {
        return categoryMapper.selectByPrimaryKey(categoryid);
    }

    @Override
    public int updateByPrimaryKeySelective(Category record) {
        return categoryMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(Category record) {
        return categoryMapper.updateByPrimaryKey(record);
    }

    @Override
    public List<Category> getCategoryList() {
        return categoryMapper.getCategoryList();
    }


}
